<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		window.onload=function(){
			var oTxt=document.getElementById('txt1');
			var oBtn=document.getElementById('btn1');
			oBtn.onclick=function (){
				var oNewWin=window.open('about:blank','_blank');
				oNewWin.document.write(oTxt.value);
			}
		}
	</script>
</head>
<body>
	<textarea id="txt1" rows="10" cols="40"></textarea><br>
	<input id="btn1" type="button" value="运行">
</body>
</html>